<template>
	<view class="bg-index">
		<image class="bg" :src="config.bg.info" mode="aspectFill"></image>
		<view hover-class="animated fadeOutUp" class="letter animated fadeInUp"
			:style="{backgroundImage:`url(${config.lettre.info})`}" @click="fadeOut" v-if="nextPage"></view>
		<view v-else class="animated fadeIn love-card" v-if="!nextPage">
			<view class="main">
				<image class="card" v-if="config.card.type==='image'" :src="config.card.info" mode="aspectFill"></image>
				<view class="text">
					<out-text :text='config.text' icon="heart-fill"></out-text>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		name: 'tem-page03',
		props: ['config'],
		data() {
			return {
				nextPage: 1,
				text: '',
			}
		},
		methods: {
			fadeOut() {
				setTimeout(() => {
					this.nextPage = 0
				}, 250)
			}
		},
	}
</script>

<style lang="scss">
	.bg {
		position: absolute;
		top: 0px;
		left: 0px;
		width: 100%;
		height: 100%;
		z-index: -10;
	}

	.c-text {
		display: flex;
		color: #FFFFFF;
		margin: 0 50rpx;
	}

	.main {
		display: flex;
		flex-direction: column;
		width: 750rpx;
		margin-top: 210rpx;
		padding: 40rpx;
		justify-content: center;
		align-items: center;

		.card {
			height: 450rpx;
			width: 630rpx;
			border-radius: 8rpx;
			border: 20rpx solid #FFFFFF;
		}

		.text {
			color: #fff;
			width: 100%;
			margin-top: 150rpx;
			border-radius: 4rpx;
			padding: 30rpx;
			background-color: rgba(255, 255, 255, 0.5);
		}
	}


	.bg-index {
		width: 100vw;
		height: 100vh;
		position: fixed;
		top: 0;
		left: 0;
		z-index: -100;
		background-position: center;
		background-size: cover;
	}

	.letter {
		width: 200rpx;
		height: 100rpx;
		margin: 35vh 275rpx;
		border-radius: 16rpx;
		box-shadow: 4rpx 4rpx 4rpx #666;
		background-position: center;
		background-size: cover;
	}
</style>
